package models

import "gorm.io/gorm"

//小说表
type Novel struct {
	gorm.Model
	Title  string `gorm:"type:varchar(30);not null;comment:小说标题"`
	Author string `gorm:"type:varchar(30);not null;comment:小说作者"`
	Types  string `gorm:"type:varchar(30);not null;comment:小说类型"`
	Img    string `gorm:"type:varchar(100);not null;comment:小说封面"`
}

//添加
func (n *Novel) Add() error {
	return DB.Create(&n).Error
}
